package game.ouroboros.traps;

import game.ouroboros.enemy.*;
import game.ouroboros.temp.*;
import game.ouroboros.*;

public class WaterShooter extends GenericTrap {
	Projectile projectile;

	public WaterShooter(float x, float y) {
		super(x, y);
		this.setDamAtk(3);
		this.setRAtak(60);
		this.atkPerSec = 5;
		this.type = 1;

	}

	void inCollision(Enemy enemy) {

	}

	// @Override
	public boolean inCollisionRange(Enemy p) {
		this.projectile = new Projectile(this, p);
		state = STATE_RELOADING;
		return true;

	}

	// @Override
	public boolean funcionando() {
		// // TODO Auto-generated method stub
		return false;
	}

	@Override
	public void update(float dealtatime) {
		stateTime += dealtatime;
		switch (state) {
		case STATE_RELOADING:
			time += dealtatime;
			if (time >= TIME_RELOADING * atkPerSec) {
				time = 0;
				state = STATE_SEARCHING;
				stateTime = 0;
			}
			break;
		case STATE_WORKING:
			// List<GameObject> l = m.getAttackSquare(this);
			// int len = l.size();
			// for(int i=0;i<len;i++){
			// ((Personagem)l.get(i)).collidedWith(this);
			// }
			state = STATE_SEARCHING;
			break;

		default:
			break;
		}

	}	}